#ifndef _UTILS_H_
#define _UTILS_H_

#include <stdio.h>

#define pr_err(fmt, arg...)     fprintf(stderr, fmt, ## arg)

// warn: dst must be a string literal
#define startswith(src, dst)    (!strncmp(src, dst, sizeof(dst) - 1))

#define abs(a, b) (((a) > (b)) ? ((a) - (b)) : ((b) - (a)))


int load(const char *file, char *buf, int maxsize);

void str_compress(char *buf, char *delim, char replace);

void str_replace(char *buf, char delim, char replace);

#endif
